package com.sealer.pattern.behavioral.command.invoker;

import com.sealer.pattern.behavioral.command.command.Command;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by sealer on 17/04/07.
 */
public class Switch {
    private List<Command> history = new ArrayList<>();

    public void storeAndExecute(Command command) {
        history.add(command);
        command.execute();
    }

    public List<Command> getHistory() {
        return history;
    }
}
